//  GET:/orders/(page)
//   返回：{list:[{products:[],id,  date, price}]}

//   生成订单
//   POST:/orders/create
//   返回: {status:success|error}

export default {
  getAll: (page, scb, fcb) => {
    fetch('/orders/' + page, {
      credentials: 'include',
      method: 'GET',
      headers: {
        'Content-Type': 'application/json',
      }
      }).then((res) => {
        return res.json()
      }).then((json) => {
        if (json) {
          scb(json)
        }
      })
  }
}